package sample.application;

import javafx.application.Application;
import javafx.fxml.FXMLLoader;
import javafx.scene.Parent;
import javafx.scene.Scene;
import javafx.stage.Stage;

import java.net.URL;

/**
 * @author 陈镇雨
 * @create 2021-08-31 9:10
 */
public class ApplicationMain extends Application {

    @Override
    public void start(Stage primaryStage) throws Exception {
        Parent root = FXMLLoader.load(getClass().getResource("../fxml/mainFrame.fxml"));
        Scene scene = new Scene(root);
        //加载css层叠样式表
        URL url_css = this.getClass().getResource("/sample/style/style.css");
        //给场景添加css样式表
        scene.getStylesheets().add(url_css.toExternalForm());
        //设置标题
        primaryStage.setTitle("简易的计算器");
        //设置滚定窗体大小
        primaryStage.setResizable(false);
        primaryStage.setScene(scene);
        primaryStage.show();
    }

    public static void main(String[] args) {
        launch(args);
    }
}
